package service.imp;

import java.util.List;

import dao.DAOFactory;
import imageUtil.Page;
import model.Supplier;
import service.SupplierService;

public class SupplierServiceImp implements SupplierService {

	@Override
	public int findByCount() throws Exception {
		return DAOFactory.getSupplierDAO().findByCount();
	}

	@Override
	public List<Supplier> findByAll(Page page) throws Exception {
		return DAOFactory.getSupplierDAO().findByAll(page);
	}

	@Override
	public boolean saveSupplier(Supplier supplier) throws Exception {
		return DAOFactory.getSupplierDAO().saveSupplier(supplier);
	}

	@Override
	public boolean updateSupplier(Supplier supplier) throws Exception {
		return DAOFactory.getSupplierDAO().updateSupplier(supplier);
	}

	@Override
	public List<Supplier> findByName() throws Exception {
		return DAOFactory.getSupplierDAO().findByName();
	}

	@Override
	public String findNameById(int id) throws Exception {
		return DAOFactory.getSupplierDAO().findNameById(id);
	}

}
